package shiyan2;

import java.util.Arrays;
import java.util.Comparator;

public class Test2 {
    public static void main1(String[] args) {
        try {
            Student S = new Student("2213203043","曹开炜","男",23);
            System.out.println("学号："+S.getsID()+" "+S.getsName()+" "+"性别："+S.getsSex()+" "+"年龄"+S.getsAge());
        }catch(Exception e){

        }
    }

    public static void main2(String[] args) {
        Add a = new Add();
        System.out.println(a.add(25,8));
        System.out.println(a.add(56.4,42.5));
    }

    public static void main3(String[] args) {
        Student1 s1 = new Student1("曹开炜",23);
        Student1 s2 = new Student1("张三",20);
        Student1 s3 = new Student1("王五",26);
        Student1[] students = {s1, s2, s3};
        Arrays.sort(students);
        System.out.println("Compareable排序后：");
        System.out.println(Arrays.toString(students));
        Arrays.sort(students, new Comparator<Student1>() {
            @Override
            public int compare(Student1 o1, Student1 o2) {
                return o1.getAge() - o2.getAge();
            }
        });
        System.out.println("Compareable排序后：");
        System.out.println(Arrays.toString(students));

    }

    public static void main(String[] args) throws Exception {
        College c = new College("2213203043","曹开炜",96,65);
        College c1 = new College("2213203044","刘俊希",84,75);
        System.out.println("学生总人数："+College.totalStudent);
        u(c);
        u(c1);
    }

    static void u(College c){
        System.out.println(c.getsID()+" "+c.getsName()+" "+"科目一:"+c.getScore1()+" "+
                "科目二："+c.getScore2()+" "+"总成绩："+c.totalScore());

    }

}
